package com.suppor.rpc.consumer;

import com.suppor.rpc.client.annotation.RpcReference;
import com.support.hello.HelloService;
import com.support.hello.ResultData;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class ClientController {
    @RpcReference(version = "1.0.0", timeout = 1000)
    private HelloService service;

    @RequestMapping(value = "/hello", method = RequestMethod.GET)
    public void run() {
        ResultData result = service.helloService("h");
        System.out.println("客户端拿到的数据: " + result);
    }

}
